<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>表格隔行变色</title>
    <script src="../../js/common.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function(){
            $('#data>tbody>tr:odd').css('backgroundColor','#444fff')
        });
    </script>
</head>
<body>
<table id="data">
    <thead>
        <tr>
            <td>name</td>
            <td>age</td>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>tom</td>
            <td>18</td>
        </tr>
        <tr>
            <td>jerry</td>
            <td>19</td>
        </tr>
        <tr>
            <td>jack</td>
            <td>19</td>
        </tr>
    </tbody>
</table>
</body>
</html>